<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.0.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#register").click(function(){
			location.href="member_registerMemberInput.do";
		});
		
		$("#login").click(function(){
			var id = $("#userId").val();
			var password = $("#password").val();
			if(id==""||password==""){
				alert("아이디나 비밀번호를 입력해 주십시요");
				return false;
			}
			location.href="member_login.do?id="+id+"&password="+password;
		});
		//추가
		$("#logoutBtn").click(function(){
			location.href="member_logout.do?command=Logout";
		});
		$("#adminBtn").click(function(){
			location.href="${initParam.root }/admin_member.do";
		});
		$("#checkBtn").click(function(){
			$.ajax({
				type:"post",
				url:"checkAttend.do",
				dataType:"json",
				success:function(jsonData){
					alert(jsonData);
					location.reload();
				}
			});
		});
		$("#userInfoBtn").click(function(){
			window.open("member_userInfo.do", "userInfo", width=100, heigth=100);
		});
		$("#messageBtn").click(function(){
			window.open("member_getmessage.do","messgeList", width=100, heigth=100);
		});
	});
</script>
<style type="text/css">
.css_header_bt {
	font-size:13px;
	font-family:Arial;
	font-weight:bold;
	-moz-border-radius:9px;
	-webkit-border-radius:9px;
	border-radius:9px;
	border:1px solid #0;
	padding:3px 6px;
	text-decoration:none;
	background:-webkit-gradient( linear, left top, left bottom, color-stop(5%, #ededed), color-stop(100%, #dfdfdf) );
	background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% );
	background:-ms-linear-gradient( top, #ededed 5%, #dfdfdf 100% );
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf');
	background-color:#ededed;
	color:#777777;
	display:inline-block;
	text-shadow:0px 0px 0px #ffffff;
 	-webkit-box-shadow:inset 1px 0px 0px 0px #ffffff;
 	-moz-box-shadow:inset 1px 0px 0px 0px #ffffff;
 	box-shadow:inset 1px 0px 0px 0px #ffffff;
}.css_header_bt:hover {
	background:-webkit-gradient( linear, left top, left bottom, color-stop(5%, #dfdfdf), color-stop(100%, #ededed) );
	background:-moz-linear-gradient( center top, #dfdfdf 5%, #ededed 100% );
	background:-ms-linear-gradient( top, #dfdfdf 5%, #ededed 100% );
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#dfdfdf', endColorstr='#ededed');
	background-color:#dfdfdf;
}.css_header_bt:active {
	position:relative;
	top:1px;
}

</style>
</head>
<body>
	<c:choose>
		<c:when test="${sessionScope.vo==null}">
	<table align="right">
		<tr>
			<th>아이디:</th><td><input type="text" id="userId" size="8"></td>
			<th>패스워드:</th><td><input type="password" id="password" size="8"></td>
			<td><input type="button" value="로그인" id="login" class="css_header_bt"></td>
			<td><input type="button" value="회원가입" id="register" class="css_header_bt"></td>
		</tr>
	</table>
		</c:when>
		<c:otherwise>
		<table align="right">
			<tr>
				<td>${sessionScope.vo.nick}님(등급 : ${sessionScope.vo.grade},  포인트 : ${sessionScope.vo.floatingPoint})</td>
				<!-- 수정 시작 -->
				<td><input type="button" value="쪽지함" id="messageBtn" class="css_header_bt"></td>
				<td><c:if test="${sessionScope.vo.grade=='Manager'}">
					  <input type="button" value="관리자 메뉴" id="adminBtn" class="css_header_bt">
					  </c:if>
					 <c:if test="${sessionScope.vo.grade!='Manager'}">
					 <input type="button" value="출석체크" id="checkBtn" class="css_header_bt">
					 </c:if>
				</td>
				<td><input type="button" value="로그아웃" id="logoutBtn" class="css_header_bt"></td>
				<td><input type="button" value="마이페이지" id="userInfoBtn" class="css_header_bt"></td>
			</tr>
		</table>
		</c:otherwise>
	</c:choose>